#include <iostream>
#include <memory>
class ShareBase
{
private:
    /* data */
protected:
    virtual void Printf()
    {

    }
public:
    virtual void Display() {
        Printf();
        std::cout << "ShareBase display\n";
    }
};


class ShareBaseA : public ShareBase
{
private:
    /* data */
private:
    virtual void Printf() {
        std::cout << "ShareBaseA Printf\n";
    }
};

class ShareBaseB : public ShareBase
{
private:
    /* data */
private:
    virtual void Printf() {
        std::cout << "ShareBaseB Printf\n";
    }
};

int main(int argc, char const *argv[])
{
    std::shared_ptr<ShareBase> base;
    if(base == NULL)
    {
        printf("std::shared_ptr<ShareBase> base is NULL\n");
    }
    base.reset(new ShareBaseA);
    base->Display();
    base.reset(new ShareBaseB);
    base->Display();
    return 0;
}
